-
Notifications
You must be signed in to change notification settings - Fork 507
Widget fix #11412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Widget fix #11412
Conversation
FWIW: AWS does have Javascript you can add to respond to challenges triggered by fetches that your JavaScript does. There may be a little bit of chicken and egg if we don't want to require pasting their code into the host page, but I think that could be avoided by hosting widget.js itself elsewhere. If it isn't possible to just tweak the WAF challenge rules to avoid the issue we could look into this. |
The widgets.js itself is not a problem. We could put it on a different server off course. But in my experiments I just put it under an exempt location in prod. (as in the static html I posted)
Loading the contents of the widget is a GET on dataverse.xhtml, our most crawled and abused page. I've been assuming there is no safe way of tweaking the rules in this case. Did you have a specific solution in mind? We could set up a "secret" alias for the page reserved for the widgets use, but that would only be "safe until discovered". I'll be happy to experiment with the javascript aws provides. But I'm not sure it's going to help us here. Since the browser is already trying, but failing to respond to the challenge. (will look into this) This is not at the top of my stack r/n, but I want to find a solution eventually. |
FWIW: I was thinking of this: https://docs.aws.amazon.com/waf/latest/developerguide/waf-js-challenge-api.html Seems like a way to pass the challenge before other page activity tries to access the protected site. Not sure it covers iframe loads, but it does look like it could cover widget.js doing a get of dataverse.xhtml and then writing into the iframe - or something. I haven't done any experimentation. |
Cool, I'll experiment with that. |
FWIW, I've tried to experiment with the AWS-recommended approach. |
What this PR does / why we need it: This PR fixes an issue and adds several improvements:
Which issue(s) this PR closes:
Special notes for your reviewer:
Suggestions on how to test this: Follow the instructions on the collection and dataset edit/theme and widgets panes to add a widget to some other website (I had good luck just using local html files, but any web page should work) and verify that the Dataverse content shows. For Harvard Dataverse, should be tested with the current challenges to verify that it either works or shows the "Max challenge attempts exceeded. Please refresh the page to try again!" message and doesn't silently fail.
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Is there a release notes update needed for this change?:
Additional documentation: